//
//  ViewController.m
//  10510登入界面
//
//  Created by student on 16/2/21.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *account;
@property (weak, nonatomic) IBOutlet UITextField *code;
@property (weak, nonatomic) IBOutlet UITextField *verify;
@property (weak, nonatomic) IBOutlet UIView *view2;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)changeValue:(id)sender
{
    self.code.secureTextEntry = !self.code.secureTextEntry;
}
- (IBAction)backgroundTag:(id)sender
{
    [self.view endEditing:YES];
}
- (IBAction)test:(id)sender
{
    if ([self.account.text isEqualToString: @"452"] || [self.code.text isEqualToString: @"123"])
    {
        UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"登入" message:@"登入成功" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
        [alertView show];
    }
    else
    {
        UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"账号密码错误" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
        
        [alertView show];
    }
    
}

@end
